/**
 * @file RST_WebSDK中使用到的所有结构体
 */

// ----------------------------------------------------------------------------------------------------------------
//     修改记录
// ----------------------------------------------------------------------------------------------------------------

/**
 * 修改记录
 * 20190325:
 *  1、新增QueryLocalFileStruct本地文件信息结构
 */

/**
 * 修改记录
 * 20190325:
 *  1、新增GetLocationDataStruct定位信息结构
 */

/**
 * 修改记录
 * 20190322:
 *  1、新增BatteryParamStruct电量信息结构
 *  2、新增QueryEventSourceInfoStruct报警事件查询源信息结构
 *  3、新增HistoryEventInfoArrayStruct报警事件查询历史信息结构
 */
 
/**
 * 修改记录
 * 20180927:
 *  1、新增OrganizationStruct组织资源信息结构
 *  2、新增OrgNodeStruct节点资源信息结构
 */

/**
 * 修改记录
 * 20180809:
 *  1、新增OrganizationStruct组织资源信息结构
 *  2、新增OrgNodeStruct节点资源信息结构
 */

/**
 * 修改记录
 * 20180808:
 *  1、新增PresetPositionListStruct预置位列表信息结构
 *  2、新增AuxiliaryDeviceListStruct辅助设备列表信息结构
 */

/**
 * 修改记录
 * 20180807:
 *  1、新增DiskInfoStruct磁盘信息结构
 *  2、新增StorageFileInfoStruct存储文件信息结构
 *  3、新增PresetPositionListStruct预置位列表信息结构
 *  4、新增AuxiliaryDeviceListStruct辅助设备列表信息结构
 *  5、新增OrganizationStruct组织资源信息结构
 *  6、新增OrgNodeStruct节点资源信息结构
 */

/**
 * 修改记录
 * 20180717:
 *  1、WindowEventStruct添加新的窗口事件信息：full_screen_window_show和full_screen_window_hide。
 */

/**
 * RST_WebSDK中使用到的所有结构体
 * @class NPCCStruct
 * @autho shaosy
 * @version 3, 0, 187, 1719
 * @readonly
 */
var NPCCStruct = {
    /**
     *******************************************************************************************************************
     **************************************************NPCCInterlayer.js************************************************
     *******************************************************************************************************************
     */

    /**
     * 初始化NPCCILY对象参数结构
     * @param debug {bool} 是否开始调试状态
     * @param cb {function} 调试信息输出回调函数
     * @param language {NPCCEnum.LanguageType} 语言对象
     * @constructor
     */
    InitParamStruct : function (debug, cb, language) {
        this.debug = (typeof debug != 'undefined' && debug === true ? true : false);
        this.callback = (typeof cb != 'undefined' ? cb : null);
        this.language = language || NPCCEnum.LanguageType.zh_CN;
    },

    /**
     * 成功登录平台后全局数据结构
     * @param hServer {Object} 服务句柄
     * @param loginParam {NPCCStruct.LoginParamStruct} 登录参数
     * @constructor
     */
    InitGlobalDataStruct: function (hServer, loginParam) {
        this.hServer = hServer;
        this.serverIP = loginParam.ip || '';
        this.serverPort = loginParam.port || 7178;
        this.password = loginParam.password || '';
        this.userName = loginParam.username || '';
        this.domain = loginParam.domain || 'root';
    },

    /**
     * 域信息结构
     * @param id {string} 唯一号，数据库自动生成的
     * @param did {string} 域id
     * @param name {string} 域名称
     * @param parentID {string} 父域唯一号
     * @param desc {string} 描述
     * @param handle {Object} 域句柄
     * @constructor
     */
    DomainStruct: function (id, did, name, parentID, desc, handle) {
        this.id = (typeof id != 'undefined' ? id : '-1');
        this.did = (typeof did != 'undefined' ? did : '');
        this.name = (typeof name != 'undefined' ? name : '');
        this.parentID = (typeof parentID != 'undefined' ? parentID : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 设备资源信息结构
     * @param did {string} 域id
     * @param resID {int} 资源id
     * @param puid {string} puid
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_DEV
     * @param resIdx {int} 资源索引
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param desc {string} 描述
     * @param bEnable {bool} 是否可用
     * @param modelType {NPCCEnum.ModelType} 型号类型，默认为NPCCEnum.ModelType.MODEL_TYPE_ENC
     * @param modelName {string} 型号
     * @param softwareVersion {string} 软件版本号
     * @param hardwareVersion {string} 硬件版本号
     * @param longitude {double} 纬度
     * @param latitude {double} 经度
     * @param deviceID {string} 设备id
     * @param resList {Array} 子资源信息，是个数组，类型有：CameraStruct、AudioStruct、TalkbackStruct等
     * @param handle {Object} 资源句柄
     * @constructor
     */
    DeviceStruct: function (did /* = 0 */, resID, puid, resType, resIdx, bOnline, name, desc, bEnable,
                            modelType /* = DEVICE_TYPE_ENC */, modelName /* = NULL */, softwareVersion /* = NULL */,
                            hardwareVersion /* = NULL */, longitude /* = 0 */, latitude /* = 0 */,
                            deviceID, resList, handle) {
        this.did = (typeof did != 'undefined' ? did : '');
        this.resID = (typeof resID != 'undefined' ? resID : -1);
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_DEV);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.modelType = (typeof modelType != 'undefined' ? modelType : NPCCEnum.ModelType.MODEL_TYPE_ENC);
        this.modelName = (typeof modelName != 'undefined' ? modelName : '');
        this.softwareVersion = (typeof softwareVersion != 'undefined' ? softwareVersion : '');
        this.hardwareVersion = (typeof hardwareVersion != 'undefined' ? hardwareVersion : '');
        this.longitude = (typeof longitude != 'undefined' ? longitude : 0.0);
        this.latitude = (typeof latitude != 'undefined' ? latitude : 0.0);
        this.deviceID = (typeof deviceID != 'undefined' ? deviceID : '');
        this.resList = resList || [];
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 组织资源信息结构
     * @param uiID {int} 组织id
     * @param uiNodeID {int} 节点id
     * @param strName {string} 名称
     * @param strDesc {string} 描述
     * @param handle {Object} 组织句柄
     * @constructor
     */
    OrganizationStruct: function (uiID, uiNodeID, strName, strDesc, handle) {
        this.uiID = (typeof uiID != 'undefined' ? uiID : -1);
        this.uiNodeID = (typeof uiNodeID != 'undefined' ? uiNodeID : -1);
        this.strName = (typeof strName != 'undefined' ? strName : '');
        this.strDesc = (typeof strDesc != 'undefined' ? strDesc : '');
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 节点资源信息结构
     * @param uiNodeIndex {int} 节点id
     * @param orgID {int} 组织id
     * @param strName {string} 名称
     * @param strDesc {string} 描述
     * @param handle {Object} 节点句柄
     * @constructor
     */
    OrgNodeStruct: function (uiNodeIndex, orgID, strName, strDesc, handle) {
        this.uiNodeIndex = (typeof uiNodeIndex != 'undefined' ? uiNodeIndex : 0);
        this.orgID = (typeof orgID != 'undefined' ? orgID : 0);
        this.strName = (typeof strName != 'undefined' ? strName : '');
        this.strDesc = (typeof strDesc != 'undefined' ? strDesc : '');
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 摄像头资源信息结构
     * @param did {string} 域id
     * @param resID {int} 资源id
     * @param puid {string} puid，跟设备的puid是同一个值
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_CAM
     * @param resIdx {int} 资源索引，一个设备下挂多个摄像头的时候，这个值就比较有用了
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param desc {string} 描述
     * @param bEnable {bool} 是否可用
     * @param handle {Object} 资源句柄
     * @constructor
     */
    CameraStruct: function (did, resID, puid, resType, resIdx, bOnline, name, desc, bEnable, handle) {
        this.did = (typeof did != 'undefined' ? did : '');
        this.resID = (typeof resID != 'undefined' ? resID : -1);
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_CAM);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 摄像头资源信息结构
     * @param puid {string} puid，跟设备的puid是同一个值
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_CAM
     * @param resIdx {int} 资源索引，一个设备下挂多个摄像头的时候，这个值就比较有用了
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param bEnable {bool} 是否可用
     * @param handle {Object} 资源句柄
     * @constructor
     */
    CameraInfoStruct: function (did, resID, puid, resType, resIdx, bOnline, name, desc, bEnable, handle) {
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_CAM);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 音频资源信息结构
     * @param did {string} 域id
     * @param resID {int} 资源id
     * @param puid {string} puid，跟设备的puid是同一个值
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_AUD
     * @param resIdx {int} 资源索引
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param desc {string} 描述
     * @param bEnable {bool} 是否可用
     * @param handle {Object} 资源句柄
     * @constructor
     */
    AudioStruct: function (did, resID, puid, resType, resIdx, bOnline, name, desc, bEnable, handle) {
        this.did = (typeof did != 'undefined' ? did : '');
        this.resID = (typeof resID != 'undefined' ? resID : -1);
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_AUD);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 对讲资源信息结构
     * @param did {string} 域id
     * @param resID {int} 资源id
     * @param puid {string} puid，跟设备的puid是同一个值
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_TBK
     * @param resIdx {int} 资源索引
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param desc {string} 描述
     * @param bEnable {bool} 是否可用
     * @param handle {Object} 资源句柄
     * @constructor
     */
    TalkbackStruct: function (did, resID, puid, resType, resIdx, bOnline, name, desc, bEnable, handle) {
        this.did = (typeof did != 'undefined' ? did : '');
        this.resID = (typeof resID != 'undefined' ? resID : -1);
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_TBK);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 定位资源信息结构
     * @param did {string} 域id
     * @param resID {int} 资源id
     * @param puid {string} puid，跟设备的puid是同一个值
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_LOC
     * @param resIdx {int} 资源索引
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param desc {string} 描述
     * @param bEnable {bool} 是否可用
     * @param handle {Object} 资源句柄
     * @constructor
     */
    LocationStruct: function (did, resID, puid, resType, resIdx, bOnline, name, desc, bEnable, handle) {
        this.did = (typeof did != 'undefined' ? did : '');
        this.resID = (typeof resID != 'undefined' ? resID : -1);
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_LOC);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 存储资源信息结构
     * @param did {string} 域id
     * @param resID {int} 资源id
     * @param puid {string} puid，跟设备的puid是同一个值
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_LOC
     * @param resIdx {int} 资源索引
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param desc {string} 描述
     * @param bEnable {bool} 是否可用
     * @param handle {Object} 资源句柄
     * @constructor
     */
    StorageStruct: function (did, resID, puid, resType, resIdx, bOnline, name, desc, bEnable, handle) {
        this.did = (typeof did != 'undefined' ? did : '');
        this.resID = (typeof resID != 'undefined' ? resID : -1);
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_STOR);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },


    /**
     * 云台资源信息结构
     * @param did {string} 域id
     * @param resID {int} 资源id
     * @param puid {string} puid，跟设备的puid是同一个值
     * @param resType {NPCCEnum.ResType} 资源类型，值肯定是NPCCEnum.ResType.RES_TYPE_PTZ
     * @param resIdx {int} 资源索引
     * @param bOnline {bool} 是否在线
     * @param name {string} 名称
     * @param desc {string} 描述
     * @param bEnable {bool} 是否可用
     * @param handle {Object} 资源句柄
     * @constructor
     */
    PTZStruct: function (did, resID, puid, resType, resIdx, bOnline, name, desc, bEnable, handle) {
        this.did = (typeof did != 'undefined' ? did : '');
        this.resID = (typeof resID != 'undefined' ? resID : -1);
        this.puid = (typeof puid != 'undefined' ? puid : '');
        this.resType = (typeof resType != 'undefined' ? resType : NPCCEnum.ResType.RES_TYPE_PTZ);
        this.resIdx = (typeof resIdx != 'undefined' ? resIdx : 0);
        this.bOnline = (typeof bOnline != 'undefined' ? bOnline : 0);
        this.name = (typeof name != 'undefined' ? name : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.bEnable = (typeof bEnable != 'undefined' ? bEnable : 0);
        this.handle = (typeof handle != 'undefined' ? handle : '');
    },

    /**
     * 视频播放窗口容器信息结构
     * @param container {string} 容器ID获取容器对象
     * @param active {bool} 窗口是否激活，true激活，false未激活
     * @param _window {NPCCStruct.WindowStruct} 播放窗口
     * @param description {string}
     * @constructor
     */
    WindowContainerStruct : function (container, active, _window, description) {
        this.container = (container && typeof container != "undefined" ? container : "");
        this.active = !!(active == true);
        this.focus = false;
        this.window = (_window && typeof _window != "undefined" ? _window : null);
        this.description = (typeof description != "undefined" ? description : {});
    },

    /**
     *******************************************************************************************************************
     **************************************************NPCCInterface.js*************************************************
     *******************************************************************************************************************
     */

    /**
     * 返回值结构
     * @param errorCode {int} 错误码
     * @param value {string} 返回值
     * @constructor
     */
    ReturnValueStruct : function (errorCode, value) {
        this.errorCode = errorCode;
        if (typeof value != 'undefined') {
            this.value =  value;
        }
    },

    /**
     * 初始化登录平台参数结构
     * @param ip {string} 地址, 如rst.pw
     * @param port {short} 端口, 如7178
     * @param domain {string} 域
     * @param username {string} 用户名
     * @param password {string} 用户密码
     * @param block {bool} 是否阻塞登录（1/true是，0/false否）
     * @constructor
     */
    LoginParamStruct : function (ip, port, domain, username, password, block) {
        this.ip = ip || 'rst.pw';
        this.port = port || 7178;
        this.domain = (typeof domain != 'undefined' && domain != null ? domain : 'root');
        this.username = (typeof username != 'undefined' && username != null ? username : '');
        this.password = (typeof password != 'undefined' && password != null ? password : '');
        this.block = (typeof block != 'undefined' && block != null ? block : 0);
    },

    /**
     * 用户详细信息结构
     * @param id {int} 用户ID
     * @param parentID {int} 父用户ID
     * @param name {string} 用户名
     * @param alias {string} 别名，目前不支持，默认为空
     * @param desc {string} 描述
     * @param deviceCount {int} 用户绑定设备数量
     * @param userType {int} 用户类型
     * @constructor
     */
    UserDetailInfoStruct: function (id, parentID, name, alias, desc, deviceCount, userType) {
        this.id = (typeof id != 'undefined' ? id : '');
        this.parentID = (typeof parentID != 'undefined' ? parentID : -1);
        this.name = (typeof name != 'undefined' ? name : '');
        this.alias = (typeof alias != 'undefined' ? alias : '');
        this.desc = (typeof desc != 'undefined' ? desc : '');
        this.deviceCount = (typeof deviceCount != 'undefined' ? deviceCount : 0);
        this.userType = (typeof userType != 'undefined' ? userType : '');
    },

    /**
     * 登录事件信息结构
     * @param eventName{string} 事件方法名，必须跟插件里定义的一致
     * @param errorCode{int} 错误码
     * @param status{int} 状态
     * @param progress{string} 登陆进度 json格式
     * @param strAddress{string} 服务器地址 json格式
     * @param usPort{string} 端口号 json格式
     * @param pServer{Object} 服务句柄
     * @constructor
     */
    LoginCallbackStruct : function(eventName, errorCode, status, progress, strAddress, usPort, pServer) {
        this.eventName = eventName || '';
        this.errorCode = typeof errorCode != 'undefined' ? (errorCode || '0') : '0';
        if (typeof status != 'undefined' && status != null && status !== '') {
            this.status = status || '0';
        }
        this.progress =  typeof progress != 'undefined' ? (progress || {}) : {};
        this.strAddress =  typeof strAddress != 'undefined' ? (strAddress || {}) : {};
        this.usPort =  typeof usPort != 'undefined' ? (usPort || {}) : {};
        this.pServer = pServer || '';
    },


    /**
     * 事件信息结构
     * @param eventName{string} 事件方法名，必须跟插件里定义的一致
     * @param handle{Object} 对象句柄（流或窗口）
     * @param status{int} 状态
     * @param errorCode{int} 错误码
     * @param keyData{string} 其他信息 json格式
     * @constructor
     */
    NotifyStruct : function(eventName, handle, status, errorCode, keyData) {
        this.eventName = eventName || '';
        this.handle = handle || '';
        if (typeof status != 'undefined' && status != null && status !== '') {
            this.status = status || '0';
            this.statusDesc = '';
            if (NPCCEnum.StreamStatusDesc[this.status]) {
                this.statusDesc = NPCCEnum.StreamStatusDesc[this.status][NPPILY.language] || '';
            }
        }
        this.errorCode = typeof errorCode != 'undefined' ? (errorCode || '0') : '0';
        this.keyData =  typeof keyData != 'undefined' ? (keyData || {}) : {};
    },

    /**
     * 事件信息结构(视频流尺寸发生变化)
     * @param eventName{string} 事件方法名，必须跟插件里定义的一致
     * @param handle{Object} 对象句柄（流或窗口）
     * @param width{int} 宽度
     * @param height{int} 高度
     * @param errorCode{int} 错误码
     * @constructor
     */
    NotifyStructImageSizeChanged : function(eventName, handle, width, height, errorCode) {
        this.eventName = eventName || '';
        this.handle = handle || '';
        this.width = width || '';
        this.height = height || '';
        this.errorCode = typeof errorCode != 'undefined' ? (errorCode || '0') : '0';
    },

    /**
     * 窗口信息结构
     * @param options{Object} 可选参数
     * @param options.container{Object} 窗口插件容器，优先判断container，其次containerId
     * @param options.containerId{string} 窗口插件容器ID
     * @param options.pwPlugin{Object} 窗口插件实例，优先判断pwPlugin，其次pwPluginName
     * @param options.pwPluginName{string} 窗口插件实例ID
     * @param options.connectId{string} 连接ID
     * @param options.pwHandle{Object} 窗口句柄
     * @param options.status{Object} 视频状态参数
     * @constructor
     */
    WindowStruct : function (options) {
        var _SELF = this;
        var options = options || {};
        this.container = (
            function() {
                if (typeof options.container != "undefined" && typeof options.container.id != "undefined") {
                    _SELF.containerId = options.container.id || document.getElementById(options.containerId || "");
                    return options.container;
                }
                else {
                    _SELF.containerId = options.containerId || "";
                    return document.getElementById(_SELF.options.containerId);
                }
            }
        )();
        this.pwPlugin = (
            function() {
                if (typeof options.pwPlugin != "undefined" && typeof options.pwPlugin.id != "undefined") {
                    _SELF.pwPluginName = options.pwPlugin.id || document.getElementById(options.pwPluginName || "");
                    return options.pwPlugin;
                }
                else {
                    _SELF.pwPluginName = options.pwPluginName || "";
                    return document.getElementById(_SELF.options.pwPluginName);
                }
            }
        )();
        this.pwHandle = options.pwHandle || "";
        this.connectId = options.connectId || "";
        this.params = {
            puid : "", // 设备PUID
            resIdx : "", // 资源索引
            cameraResHandle : "" , // 视频流句柄
            audioResHandle : "" , // 音频流句柄
            talkbackResHandle: '', // 对讲流句柄
            locationResHandle: '', // 定位流句柄
            ptzResHandle: '', // 云台流句柄
            mediaHandle: '', // 媒体句柄
        };
        this.status = {
            playvideoing : (options.status ? !!(options.status.playvideoing == true) : false),
            playaudioing : (options.status ? !!(options.status.playaudioing == true) : false),
            playcalling : (options.status ? !!(options.status.playcalling == true) : false),
            playtalking : (options.status ? !!(options.status.playtalking == true) : false),
            playrecording : (options.status ? !!(options.status.playrecording == true) : false),
            playlocation : (options.status ? !!(options.status.playlocation == true) : false),
            playstorage : (options.status ? !!(options.status.playstorage == true) : false),
            isfullscreening: (options.status ? !!(options.status.isfullscreening == true) : false),
        };
    },

    /**
     * 窗口事件信息结构
     * @constructor
     */
    WindowEventStruct : function() {
        // 鼠标左键点击
        this.lbtn_click = {
            name : "lbtn_click",
            status : (typeof lbtn_click != "undefined" && typeof lbtn_click.status != "undefined" ? !!
                (lbtn_click.status == true) : false),
            callback : (typeof lbtn_click != "undefined" && typeof lbtn_click.callback != "undefined" &&
                lbtn_click.callback.constructor == Function ? lbtn_click.callback : function(){})
        };
        this.full_screen_window_show = {
            name : "full_screen_window_show",
            status : (typeof full_screen_window_show != "undefined" && typeof full_screen_window_show.status != "undefined" ? !!
                (full_screen_window_show.status == true) : false),
            callback : (typeof full_screen_window_show != "undefined" && typeof full_screen_window_show.callback != "undefined" &&
            full_screen_window_show.callback.constructor == Function ? full_screen_window_show.callback : function(){})
        };
        this.full_screen_window_hide = {
            name : "full_screen_window_hide",
            status : (typeof full_screen_window_hide != "undefined" && typeof full_screen_window_hide.status != "undefined" ? !!
                (full_screen_window_hide.status == true) : false),
            callback : (typeof full_screen_window_hide != "undefined" && typeof full_screen_window_hide.callback != "undefined" &&
            full_screen_window_hide.callback.constructor == Function ? full_screen_window_hide.callback : function(){})
        };
        this.full_screen_window_show1 = {
            name : "full_screen_window_show1",
            status : (typeof full_screen_window_show1 != "undefined" && typeof full_screen_window_show1.status != "undefined" ? !!
                (full_screen_window_show1.status == true) : false),
            callback : (typeof full_screen_window_show1 != "undefined" && typeof full_screen_window_show1.callback != "undefined" &&
            full_screen_window_show1.callback.constructor == Function ? full_screen_window_show1.callback : function(){})
        };
        this.rbtn_click = {
            name : "rbtn_click",
            status : (typeof rbtn_click != "undefined" && typeof rbtn_click.status != "undefined" ? !!
                (rbtn_click.status == true) : false),
            callback : (typeof rbtn_click != "undefined" && typeof rbtn_click.callback != "undefined" &&
            rbtn_click.callback.constructor == Function ? rbtn_click.callback : function(){})
        };
        this.menu_command = {
            name : "menu_command",
            status : (typeof menu_command != "undefined" && typeof menu_command.status != "undefined" ? !!
                (menu_command.status == true) : false),
            callback : (typeof menu_command != "undefined" && typeof menu_command.callback != "undefined" &&
            menu_command.callback.constructor == Function ? menu_command.callback : function(){})
        };
    },

    /**
     * 磁盘信息结构
     * @param status {Int} 磁盘状态
     * @param strLetter {string} 盘符
     * @param diskType {} 磁盘类型
     * @param systemType {Int} 存储系统
     * @param uiCapacity {Int} 磁盘容量
     * @param uiUsedSpace {Int} 已使用的磁盘容量
     * @constructor
     */
    DiskInfoStruct : function(status, strLetter, diskType, systemType, uiCapacity, uiUsedSpace) {
        this.status = (typeof status != 'undefined' && status != null ? status : 0);
        this.strLetter = (typeof strLetter != 'undefined' && strLetter != null ? strLetter : '');
        this.diskType = (typeof diskType != 'undefined' && diskType != null ? diskType : 0);
        this.systemType = (typeof systemType != 'undefined' && systemType != null ? systemType : 0);
        this.uiCapacity = (typeof uiCapacity != 'undefined' && uiCapacity != null ? uiCapacity : 0);
        this.uiUsedSpace = (typeof uiUsedSpace != 'undefined' && uiUsedSpace != null ? uiUsedSpace : 0);
    },

    /**
     * 存储文件信息结构
     * @param strFileName {string} 文件名称
     * @param strLetter {string} 盘符
     * @param strStartTime {string} 开始时间
     * @param strEndTime {string} 结束时间
     * @param uiStartTimeUTC {Int} UTC开始时间
     * @param uiEndTimeUTC {Int} UTC结束时间
     * @param uiFileSize {Int} 文件大小
     * @param strFilePath {string} 文件存储路径
     * @param straReason {Array} 存储原因
     * @param uiNo {Int} 秒内编号，仅图片有效
     * @constructor
     */
    StorageFileInfoStruct: function(strFileName, strLetter, strStartTime, strEndTime, uiStartTimeUTC, uiEndTimeUTC, uiFileSize, strFilePath, straReason, uiNo) {
        this.strFileName = (typeof strFileName != 'undefined' && strFileName != null ? strFileName : '');
        this.strLetter = (typeof strLetter != 'undefined' && strLetter != null ? strLetter : '');
        this.strStartTime = (typeof strStartTime != 'undefined' && strStartTime != null ? strStartTime : '');
        this.strEndTime = (typeof strEndTime != 'undefined' && strEndTime != null ? strEndTime : '');
        this.uiStartTimeUTC = (typeof uiStartTimeUTC != 'undefined' && uiStartTimeUTC != null ? uiStartTimeUTC : 0);
        this.uiEndTimeUTC = (typeof uiEndTimeUTC != 'undefined' && uiEndTimeUTC != null ? uiEndTimeUTC : 0);
        this.uiFileSize = (typeof uiFileSize != 'undefined' && uiFileSize != null ? uiFileSize : 0);
        this.strFilePath = (typeof strFilePath != 'undefined' && strFilePath != null ? strFilePath : '');
        this.straReason = (typeof straReason != 'undefined' && straReason != null ? straReason : []);
        this.uiNo = (typeof uiNo != 'undefined' && uiNo != null ? uiNo : 0);
    },

    /**
     * 下载文件信息结构
     * @param Progress {string} 下载进度
     * @param Total {string} 总大小
     * @param Transfer {string} 发送大小
     * @param TransferSizeStream {string} 发送大小(流式)
     * @constructor
     */
    loadFileInfoStruct: function(Progress, Total, Transfer, TransferSizeStream) {
        this.Progress = (typeof Progress != 'undefined' && Progress != null ? Progress : '');
        this.Total = (typeof Total != 'undefined' && Total != null ? Total : '');
        this.Transfer = (typeof Transfer != 'undefined' && Transfer != null ? Transfer : '');
        this.TransferSizeStream = (typeof TransferSizeStream != 'undefined' && TransferSizeStream != null ? TransferSizeStream : '');
    },
    /**
     * 预置位列表信息结构
     * @param index {Int} 索引
     * @param descInfo {string} 预置位描述信息
     * @constructor
     */
    PresetPositionListStruct : function(index, descInfo) {
        this.index = (typeof index != 'undefined' && index != null ? index : 0);
        this.descInfo = (typeof descInfo != 'undefined' && descInfo != null ? descInfo : '');
    },

    /**
     * 辅助设备列表信息结构
     * @param index {Int} 索引
     * @param descInfo {string} 预置位描述信息
     * @constructor
     */
    AuxiliaryDeviceListStruct : function(index, descInfo) {
        this.index = (typeof index != 'undefined' && index != null ? index : 0);
        this.descInfo = (typeof descInfo != 'undefined' && descInfo != null ? descInfo : '');
    },

    /**
     * 电量信息结构
     * @param Charging {Bool} 是否在充电
     * @param Capacity {String} 电量
     */
    BatteryParamStruct: function(Charging, Capacity) {
        this.Charging = (typeof Charging != 'undefined' && Charging != null ? Charging : 0);
        this.Capacity = (typeof Capacity != 'undefined' && Capacity != null ? Capacity : '');
    },

    /**
     * 报警事件查询源信息结构
     * @param DID {String} 域的DID
     * @param RC {String} 摄像头索引
     * @param RT {String} 摄像头类型
     * @param SID {String} 摄像头的PUID
     * @param SType {String} 源类型
     */
    QueryEventSourceInfoStruct: function(DID, RC, RT, SID, SType) {
        this.DID = (typeof DID != 'undefined' && DID != null ? DID : -1);
        this.RC = (typeof RC != 'undefined' && RC != null ? RC : -1);
        this.RT = (typeof RT != 'undefined' && RT != null ? RT : -1);
        this.SID = (typeof SID != 'undefined' && SID != null ? SID : -1);
        this.SType = (typeof SType != 'undefined' && SType != null ? SType : -1);
    },

    /**
     * 报警事件查询历史信息结构
     * @param D {Array} 信息
     * @param DID {String} 域的DID
     * @param ID {String} 报警类型
     * @param RC {String} 摄像头索引
     * @param RT {String} 摄像头类型
     * @param SID {String} 摄像头的PUID
     * @param SType {String} 源类型
     * @param T {String} 时间
     */
    HistoryEventInfoArrayStruct: function(DID, ID, RC, RT, SID, SType, T, D) {
        this.DID = (typeof DID != 'undefined' && DID != null ? DID : -1);
        this.ID = (typeof ID != 'undefined' && ID != null ? ID : -1);
        this.RC = (typeof RC != 'undefined' && RC != null ? RC : -1);
        this.RT = (typeof RT != 'undefined' && RT != null ? RT : -1);
        this.SID = (typeof SID != 'undefined' && SID != null ? SID : -1);
        this.SType = (typeof SType != 'undefined' && SType != null ? SType : -1);
        this.T = (typeof T != 'undefined' && T != null ? T : -1);
        this.D = {}
    },

    /**
     * 查询定位信息
     * @param latitude {Array} 经度
     * @param longitude {String} 纬度
     * @param Bearing {String} 方向，单位度， 0-359，0为正北，顺时针增加
     * @param Speed {String} 速度，单位km/h
     * @param Altitude {String} 海拔，单位米
     * @param UTCTime {String} 定位时间，utc时间
     * @param LocationSystemType {int} 定位类型,1:北斗 2:GPS 3:GALILEO 4: GLONASS 5混合系统
     * @param State {int} 定位状态，0:无模块，1:无信号, 2:有信号
     */
    GetLocationDataStruct: function(latitude, longitude, Bearing, Speed, Altitude, UTCTime, LocationSystemType, State) {
        this.latitude = (typeof latitude != 'undefined' && latitude != null ? latitude : -1);
        this.longitude = (typeof longitude != 'undefined' && longitude != null ? longitude : -1);
        this.Bearing = (typeof Bearing != 'undefined' && Bearing != null ? Bearing : -1);
        this.Speed = (typeof Speed != 'undefined' && Speed != null ? Speed : -1);
        this.Altitude = (typeof Altitude != 'undefined' && Altitude != null ? Altitude : -1);
        this.UTCTime = (typeof UTCTime != 'undefined' && UTCTime != null ? UTCTime : -1);
        this.LocationSystemType = (typeof LocationSystemType != 'undefined' && LocationSystemType != null ? LocationSystemType : -1);
        this.State = (typeof State != 'undefined' && State != null ? State : -1);
    },

    /**
     * 查询本地抓拍与本地录像文件信息
     * @param FilePath {Array} 文件路径
     * @param FileName {String} 文件名称
     * @param FileSize {String} 文件大小
     * @param StartTime {String} 开始时间
     * @param EndTime {String} 结束时间（本地抓拍无结束时间）
     */
    QueryLocalFileStruct: function(FilePath, FileName, FileSize, StartTime, EndTime) {
        this.FilePath = (typeof FilePath != 'undefined' && FilePath != null ? FilePath : -1);
        this.FileName = (typeof FileName != 'undefined' && FileName != null ? FileName : -1);
        this.FileSize = (typeof FileSize != 'undefined' && FileSize != null ? FileSize : -1);
        this.StartTime = (typeof StartTime != 'undefined' && StartTime != null ? StartTime : -1);
        this.EndTime = (typeof EndTime != 'undefined' && EndTime != null ? EndTime : -1);
    },

    end : true
};